// SPDX-License-Identifier: GPL-2.0
/*
 * SCHEDULE: TASK STATE [RSDTZXKW]
 *
 * (C) 2024.05.19 BiscuitOS <buddy.zhang@aliyun.com>
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>

#define DEV_PATH		"/dev/BiscuitOS"
#define BISCUITOS_IO		0xAE
#define BISCUITOS_RUN		_IO(BISCUITOS_IO, 0x01)

int main()
{
	int fd;

	/* open device */
	fd = open(DEV_PATH, O_RDWR);
	if (fd < 0) {
		printf("ERROR: Can't open %s\n", DEV_PATH);
		return -1;
	}

	while (1) {
		sleep(3);
		/* WAKEUP KTHREAD */
		ioctl(fd, BISCUITOS_RUN, (unsigned long)0);
	}

	close(fd);
	return 0;
}
